﻿using System;

using OpenQA.Selenium;

using NUnit.Framework;

namespace mvcForum.Tests.WebUI {

	public class F001_PostDates {
		private IWebDriver driver;
		private String forumName;

		#region Initialization and cleanup
		[TestFixtureSetUp]
		public void TestInitialize() {
			driver = TestHelper.GetDriver();

			forumName = Guid.NewGuid().ToString();

			driver.LogOn(Constants.Users.Admin.Email, Constants.Users.Admin.Password);
			driver.CreateForum("Test board", "Category 1", forumName, "", 1);
			driver.SetStandardAccess("Test board", "Category 1", forumName);
			driver.DisableAntiSpam();
			driver.DisableAkismet();
			driver.LogOff();
		}

		[TestFixtureTearDown]
		public void TestCleanup() {
			if (driver != null) {
				driver.Close();
			}
		}
		#endregion

		//[Test]
		public void FirstPost() {
			driver.LogOn(Constants.Users.Moderator.Email, Constants.Users.Moderator.Password);
			driver.GoToForum(forumName);
			IWebElement date = driver.FindElement(By.Id("middle5")).FindElement(By.TagName("p"));

			driver.CreateTopic(forumName, String.Format("Posted around UTC: {0}", DateTime.UtcNow), "bla bla bla");

			// TODO:
		}
	}
}